# delimit ;
capture program drop tsim;

program tsim, rclass;
version 12;
preserve;
metareg beta  if lab == 1, wsse(se_beta)  eb;
local pp1 = e(tau2);
restore;
preserve;
metareg beta  if lab == 0, wsse(se_beta)  eb;
local pp2 = e(tau2);
restore;
return scalar hh= `pp1'  - `pp2';
end;

bootstrap r(hh), reps(100): tsim;
matrix b = e(b);
matrix se = e(se);

local Ztau = abs(b[1,1])/se[1,1];
scalar ptau = 2*(1 - normal(`Ztau') );
